<?php

require_once('../../config/maptrick.conf.php');
require_once(SITE_ROOT . "config/session.php");
require_once(SITE_ROOT . 'class/logic/LogicCoolness.class.php');
require_once(SITE_ROOT . 'class/db/DBTeam.class.php');

try {
	if ($_GET["pass"] != SCRIPT_PWD) die("Incorrect password");
	
	$dbteam = new DBTeam();
	$teams = $dbteam->getLooseTeams();	
	$logic = LogicCoolness::getInstance();
	
	foreach ($teams as $team) {
		$logic->delete($team->getTeamID());
		echo "Team (TeamID: " . $team->getTeamID() . ") deleted<br />";
	}
}
catch (Exception $e) {
	echo $e->getMessage();
}

?>